<!-- 通用页面 -->
<template>
  <div class="page">
    <div class="page_box" :class="pBottom">
      <div v-if="content" class="page_box_content content" :class="pBottom">
        <div class="p0">
          <div v-html="content"></div>
          <!-- 参展表单 -->
          <div v-if="path == '/page/whyexhibit'">
              <Exhibit></Exhibit>
          </div>
        </div>
      </div>
      <div class="page_box_content ptb50" v-else>
        <common-no-data :text="$t('noData')"></common-no-data>
      </div>
    </div>
    <loading v-if="loading"></loading>
  </div>
</template>

<script>
export default {
  layout: "front",
  data() {
    return {
      loading: false,
    };
  },
  computed: {
    content() {
      return this.$store.state.seo.pageContent;
    },
    title() {
      return this.$store.state.seo.title || "pchi";
    },
    // 底部padding-bottom需要置为0时添加
    pBottom() {
      let path = this.path;
      const list = ["/page/contactus",'/page/whyexhibit','/page/floorplan'];
      let flag = list.some((item) => {
        return item == path;
      });
      if (flag) {
        return "pb0";
      }
    },
  },
  mounted() {
    if (this.$store.state.seo.noPage) {
      this.$router.push({
        path: "/404",
      });
      return;
    }
    let myEvent = new CustomEvent("CustomPageEvent", {
      detail: this,
    });
    // 随后在对应的元素上触发该事件
    if (window.dispatchEvent) {
      window.dispatchEvent(myEvent);
    } else {
      window.fireEvent(myEvent);
    }
    window.join = this.getData;
  },
  methods: {
  },
};
</script>

<style lang="scss" scoped>
.page {
  padding: 0;

  .pb0 {
    padding-bottom: 0 !important;
  }

  .fBase {
    font-size: 14px;
  }

  &_box {
    padding-bottom: 50px;

    &_content {
      &.ptb50 {
        padding: 50px 0;
      }
    }

    .p0 {
      padding: 0;
    }
  }
}

@media (max-width: 767px) {
  .page {
    &_box {
      padding-bottom: 0px;
      &_content {
        &.content {
          padding: 0 0 50px;
        }
      }
    }
  }
}
</style>
